package com.woniuxy.stage3demo.mapper.gy;
import com.woniuxy.stage3demo.bean.caicai.UserInfoBean;
import com.woniuxy.stage3demo.bean.hpxbean.OrderBean;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface OverdueUserMapper {
    //通过用户信息(id)查询配偶信息
    @ResultType(UserInfoBean.class)
    @Select("select ui.id id,ui.name name,ui.gender gender,ui.national national ,ui.birthday birthday," +
            "ui.age age,ui.authority authority,ui.validity validity," +
            "ui.address address,ui.telphone telphone," +
            "ui.card_id cardId,ui.address_now addressNow,ui.marry_status marryStatus" +
            ",ui.edu edu,ui.political_status politicalStatus,ui.del_flag delFlag from user u,user_infor ui where u.user_infor_id_2=ui.id and u.id=#{id}")
    public UserInfoBean findSpouseById(@Param("id") int id);

    //根据订单ID查询担保人信息
//    @ResultType(UserInfoBean.class)
//    @Select("select ui.id id,ui.name name,ui.gender gender,ui.national national ,ui.birthday birthday," +
//            "ui.age age,ui.authority authority,ui.validity validity," +
//            "ui.address address,ui.telphone telphone," +
//            "ui.card_id cardId,ui.address_now addressNow,ui.marry_status marryStatus" +
//            ",ui.political_status politicalStatus,ui.del_flag delFlag from user u,user_info ui where u.user_infor_id_3=ui.id and u.id=#{id}")
    public OrderBean findGuaranteeById(@Param("id") int id);
}
